package com.lagou.server;

import com.lagou.export.RpcExportUtils;
import com.lagou.service.UserServiceImpl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@ComponentScan("com.lagou")
public class ServerBootstrap {

    public static void main(String[] args) throws InterruptedException {

        SpringApplication.run(ServerBootstrap.class, args);



        String ip = "127.0.0.1";
//            解析port
        Integer port = Integer.parseInt(args[0]);

        UserServiceImpl.startServer("127.0.0.1",port);

        //暴露服务
        RpcExportUtils.export(ip, port);
    }



}
